import requests from '@/lib/server'
const api = {
    // 首页开始
    // 推荐歌单
    recommend: "/personalized",
    // 轮播图
    banner: '/banner',
    // 独家放送
    private: "personalized/privatecontent",
    // 最新音乐
    newMusic: "personalized/newsong",
    // allmusiclist 开始

    // allmusiclist 网格
    allmusiclist: "/top/playlist/",
    // 歌单类型分类 弹框
    catlist: "playlist/catlist",
    // 热门标签
    hot: '/playlist/hot',

    // ranklist开始
    topList: '/toplist',
    musicDetail: '/playlist/detail',
    // 歌曲信息
    SongsDetail: '/song/detail',
    // 歌手开始
    // 歌手信息
    artist: '/artist/list',
    // mv 开始
    //  mv首页
    mvFirst: '/mv/first',
    mvUrl: "/mv/url",
    // mv评论
    mvComment: '/comment/mv',
    // 评论页 相关推荐
    simi: '/simi/mv',
    // 推荐mv
    RecommendMv: '/top/mv',
    // 最新音乐
    topSong: "/top/song",
    topSongDetail: '/song/detail',
    // 歌单详情
    playDetail: '/playlist/detail',
    // 播放音乐
    playMusic: '/song/url',
    // 歌词
    lyric: "/lyric",
    // 歌曲评论
    comment: '/comment/music'
    // /simi/mv?mvid=14593160
}
// homeGridList 传递泛型
// 推荐歌单
export const reqRecommend = () => requests<resHomeGrid<homeGridList[]>>({ url: api.recommend, method: 'post', params: { limit: 10 } })
// 轮播图
export const reqBanner = () => requests<resHomeBanner<banners[]>>({ url: api.banner, method: 'post' })
// 独家放送
export const reqPrivate = () => requests<resPrivate<Oneself[]>>({ url: api.private, method: 'post' })
// 最新音乐
export const reqNewMusic = () => requests<resPrivate<NewMusic[]>>({ url: api.newMusic, method: 'post' })

// allmusiclist 开始
// 歌单面板
export const reqAllmusiclist = (params: { offset: number }) => requests<resMusicList<musicList[]>>({ url: api.allmusiclist, method: 'post', params })
// 歌单分类 分页器
export const reqCatList = (before?: number | string) => requests<CatList>({ url: api.catlist, method: 'post', params: before })
// 热门标签
export const reqSelectHot = () => requests({ url: api.hot, method: 'post' })
// rankList 开始
export const reqTopList = () => requests<reqRankList>({ url: api.topList, method: 'post' })
// 热门
export const reqMusicDetail = (id: number) => requests({ url: api.musicDetail, method: 'post', params: { id } })
export const reqSongsDetail = (ids: number) => requests({ url: api.SongsDetail, method: 'post', params: { ids } })
// 歌手开始
// 歌手
export const reqArtist = (params: sendParams) => requests({ url: api.artist, method: 'post', params })
// mv开始
// mv首页
export const reqMvFirst = (params: sendParams) => requests({ url: api.mvFirst, method: 'post', params })
//  推荐mv 
export const reqRecommendMv = (params: sendParams) => requests({ url: api.RecommendMv, method: 'post', params })
// mv 详情
export const reqMvDetail = (id: number | string) => requests<res<MvDetail>>({ url: api.mvUrl, method: 'post', params: { id } })
// 详情页 相关推荐
export const reqMvSimi = (mvid: number | string) => requests({ url: api.simi, method: 'post', params: { mvid } })

// 最新音乐 /top/song
export const reqTopSong = (type: string | number) => requests({ url: api.topSong, method: 'post', params: { type: type } })
//  最新音乐详情 /song/detail
export const reqTopSongDetail = (ids: string | number) => requests({ url: api.topSongDetail, method: 'post', params: { id: ids } })
// 歌单详情
export const reqPlayDetail = (id: string | number) => requests({ url: api.playDetail, method: 'post', params: { id: id } })
// 播放音乐
export const reqPlayMusic = (id: string | number) => requests({ url: api.playMusic, method: 'post', params: { id: id } })
// 歌词
export const reqLyric = (id: string | number) => requests({ url: api.lyric, method: 'post', params: { id: id } })
// 歌曲评论
export const reqComment = (params: sendParams) => requests({ url: api.comment, method: 'get', params })
// mv评论
export const reqMvComment = (params: sendParams) => requests({ url: api.mvComment, method: 'get', params })






